import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/admin/login',
    method: 'post',
    data
  })
}
export function register(data) {
  return request({
    url: '/admin/register',
    method: 'post',
    data
  })
}
export function getInfo() {
  return request({
    url: '/admin/userinfo',
    method: 'get',
    params: {}
  })
}

export function getUserList(params) {
  return request({
    url: '/admin/userList',
    method: 'get',
    params
  })
}
export function changeRole(data) {
  return request({
    url: '/admin/changeRole',
    method: 'post',
    data
  })
}
export function getPublicKey() {
  return request({
    url: '/keys',
    method: 'get',
    params: {}
  })
}
